<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
    //js中定义变量var，java非常严谨String,int,long
    var x=10;
    var y=20;

    console.log(x+y);

    var a=10,b=20;
    console.log(a*b);
    
    console.log(x);//10
    var x=100;//java中局部变量是不能重复定义
    console.log(x);//100,js语言灵活，变量如果再次声明，前面声明被覆盖
    console.log(typeof(x));
    
    var x="abc";//类型可以改变,java中不行的
    console.log(x);
    console.log(typeof(x));
    </script>
</head>
<body>
    
</body>
</html>